﻿{% load filter %}
{% extends '1base.html' %}
{% block title %}
<title>Wow Dkp Engine</title>
<meta name="Keywords" content="wow,dkp"/>
<meta name="description" content="A wow dkp system" />
<script type="text/javascript">
	//<![CDATA[
	$(document).ready(function(){
	$(".widget-content").hide();
	$(".widget-title").click(function(){
		$(this).next(".widget-content").slideToggle("slow").siblings(".widget-content:visible").slideUp("slow");
		$(this).toggleClass("actived");
		$(this).siblings(".widget-title").removeClass("actived");
	});
});
	//]]>
</script>
<script type="text/javascript" src="http://www.wowhead.com/widgets/power.js"></script>
{% endblock %}
{% block headline %}
{% endblock %}
{% block secondmenu %}
{% include 'second_menu.html'%}
{% endblock %}
{% block content %}
	<div>
		<table class="datalist" cellspacing="0" style="border-collapse:collapse">
			<thead>
				<tr>
					<th>{{ multi_language.ca_summary }}:</th>
					<th>{{ multi_language.ca_start }}:</th>
					<th>{{ multi_language.ca_end }}</th>
					<th>{{ multi_language.ca_duration }}</th>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td>{{ event.summary }}</td>
					<td>{{ event.start }}</td>
					<td>{{ event.end }}</td>
					<td>{{ event.get_duration_h }}h {{ event.get_duration_m }}m</td>
				</tr>
			</tbody>
		</table>
	</div>

	<div class="item">
		<div class="item-title"><b>{{ multi_language.ca_event_members }}</b></div>
		<div class="item-body">
		{% for player in players %}
			<b><a href="/pub/players/{{ player.player_name }}" style='color:{{ player.player_class|classcolor }}'>{{ player.player_name }}</a></b>
			{% if forloop.last %}<br /><br /><b>{{ multi_language.ca_total }} :</b> {{ forloop.counter }}{% endif %}
		{% endfor %}
		</div>
		{% if admin %}
		<div class="item-meta">
		<b><a href="/admin/events/members/{{eventid}}" title="Choose Members">{{ multi_language.ca_choose_members }}</a></b>
		</div>
		{% endif %}
	</div>

	<div class="item">
		<div class="item-title"><b>{{ multi_language.ca_event_actions }}</b></div>
		{% if actions_num %}
		<div class="item-body">
			{% for action in actions %}
			<div class="widget">
				<div class="widget-title">
					<span><b>{{ action.title }} </b></span>
					<span><b>{{ multi_language.ca_score }} : </b>{{ action.score }}</span>
					<span><b>{{ multi_language.ca_num }} : </b>{{ action.get_players_num }}</span>
					{% if admin %}
					<a href="/admin/events/action/edit/{{ action.key.id }}">{{ multi_language.ca_edit }}</a>
					<a href="/admin/events/action/delete/{{ action.key.id }}">{{ multi_language.ca_delete }}</a>
					{% endif %}
				</div>
				<div class="widget-content">
					<div class="widget-summary">{{ action.summary }}</div>
					<div class="widget-info">
					{% for player in action.get_players %}
					<a href="/pub/players/{{ player.player_name }}" style='color:{{ player.player_class|classcolor }}'>{{ player.player_name }}</a>
					{% endfor %}
					</div>
				</div>
			</div>
			<br />
			{% endfor %}
		</div>
		{% endif %}
		{% if admin %}
		<div class="item-meta">
			<b><a href="/admin/events/action/add/{{eventid}}" title="Add Action">{{ multi_language.ca_add_actions }}</a></b>
		</div>
		{% endif %}
	</div>



	<div class="item">
		<div class="item-title"><b>{{ multi_language.ca_event_reward }}</b></div>
		{% if rewards_num %}
		<div class="item-body">
			{% for action in rewards %}
			<div class="widget">
				<div class="widget-title">
					<span><b>{{ action.title }} </b></span>
					<span><b>{{ multi_language.ca_score }} : </b>{{ action.score }}</span>
					<span><b>{{ multi_language.ca_num }} : </b>{{ action.get_players_num }}</span>
					{% if admin %}
					<a href="/admin/events/reward/edit/{{ action.key.id }}">{{ multi_language.ca_edit }}</a>
					<a href="/admin/events/reward/delete/{{ action.key.id }}">{{ multi_language.ca_delete }}</a>
					{% endif %}
				</div>
				<div class="widget-content">
					<div class="widget-summary">{{ action.summary }}</div>
					<div class="widget-info">
					{% for player in action.get_players %}
					<a href="/pub/players/{{ player.player_name }}" style='color:{{ player.player_class|classcolor }}'>{{ player.player_name }}</a>
					{% endfor %}
					</div>
				</div>
			</div>
			<br />
			{% endfor %}
		</div>
		{% endif %}
		{% if admin %}
		<div class="item-meta">
			<b><a href="/admin/events/reward/add/{{eventid}}" title="Add Action">{{ multi_language.ca_add_reward }}</a></b>
		</div>
		{% endif %}

	</div>

	<div class="item">
		<div class="item-title"><b>{{ multi_language.ca_event_punish }}</b></div>
		{% if punishment_num %}
		<div class="item-body">
			{% for action in punishment %}
			<div class="widget">
				<div class="widget-title">
					<span><b>{{ action.title }} </b></span>
					<span><b>{{ multi_language.ca_score }} : </b>{{ action.score }}</span>
					<span><b>{{ multi_language.ca_num }} : </b>{{ action.get_players_num }}</span>
					{% ifequal admin 0 %}
					<a href="/admin/events/punishment/edit/{{ action.key.id }}">{{ multi_language.ca_edit }}</a>
					<a href="/admin/events/reward/delete/{{ action.key.id }}">{{ multi_language.ca_delete }}</a>
					{% endifequal %}
				</div>
				<div class="widget-content">
					<div class="widget-summary">{{ action.summary }}</div>
					<div class="widget-info">
					{% for player in action.get_players %}
					<a href="/pub/players/{{ player.player_name }}" style='color:{{ player.player_class|classcolor }}'>
					{{ player.player_name }}
					</a>
					{% endfor %}
					</div>
				</div>
			</div>
			<br />
			{% endfor %}
		</div>
		{% endif %}
		{% if admin %}
		<div class="item-meta">
			<b><a href="/admin/events/punishment/add/{{eventid}}" title="Add Action">{{ multi_language.ca_add_punish }}</a></b>
		</div>
		{% endif %}
	</div>

	<div class="item">
		<div class="item-title"><b>{{ multi_language.ca_event_loot}}</b></div>
		{% if loots_num %}
		<div class="item-body">
		<table class="datalist" cellspacing="0" style="border-collapse:collapse">
			<thead>
				<tr>
					<th align="left">{{ multi_language.ca_gear }}</th>
					<th align="left">{{ multi_language.ca_players }}</th>
					<th align="left">{{ multi_language.ca_cost }}</th>
					{% if admin %}
					<th align="left">{{ multi_language.ca_edit }}</th>
					<th align="left">{{ multi_language.ca_delete }}</th>
					{% endif %}
				</tr>
			</thead>
			<tbody>
			{% for loot in loots %}
				<tr class="green-back">
					<td><a style='color:#{{ loot.gear_color }}' href="http://www.wowhead.com/?item={{loot.gear_id}}">{{ loot.gear_name }}</a></td>
					<td style='color:{{ loot.gear_player.player_class|classcolor }}'><b>{{ loot.gear_player.player_name}}</b></td>
					<td>{{ loot.gear_costs}}</td>
					{% if admin %}
					<td align="left">
					<a href="/admin/loot/edit/{{ loot.key.id }}">{{ multi_language.ca_edit }}</a>
					</td>
					<td align="left">
					<a href="/admin/loot/delete/{{ loot.key.id }}">{{ multi_language.ca_delete }}</a>
					</td>
					{% endif %}
				</tr>
			{% endfor %}
			</tbody>
		</table>
		</div>
		{% endif %}
		{% if admin %}
		<div class="item-meta">
		<b><a href="/admin/loot/add/{{eventid}}" >{{ multi_language.ca_add_loot }}</a></b>
		</div>
		{% endif %}
	</div>
{% endblock%}
{% block siderbar %}
	{% include 'forumSiderbar.html' %}
{% endblock%}